<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>教师管理</title>
    <link rel="stylesheet" href="/css/layui.css">
    <link rel="stylesheet" href="/css/dp01.css">
    <script src="/js/jquery-3.7.1.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/layui-v2.5.7/dist/layui.all.js"></script>

</head>
<body>
<div class="layui-container">
    <h1>教师信息管理页面</h1>
    <!-- 添加姓名查询功能 -->
    <div class="layui-row">
        <div class="layui-col-xs12">
            <input type="text" id="searchName" placeholder="请输入教师姓名" class="layui-input" style="width: 200px; display: inline-block;">
            <button id="searchBtn" class="layui-btn layui-btn-normal">查询</button>
        </div>
    </div>

    <!-- 显示查询结果 -->
    <div id="searchResult" style="margin-top: 20px; display: none;">
        <h3>查询结果:</h3>
        <table class="layui-table" lay-even>
            <thead>
            <tr>
                <th>id</th>
                <th>姓名</th>
                <th>性别</th>
                <th>年龄</th>
                <th>工号</th>
            </tr>
            </thead>
            <tbody id="teacherSearchResult">
            </tbody>
        </table>
    </div>

    <!-- 添加教师按钮 -->
    <button id="addteacherBtn" class="layui-btn layui-btn-normal">添加教师</button>

    <!-- 教师列表 -->
    <table id="teacherTable" class="layui-table" lay-even>
        <thead>
        <tr>
            <th>ID</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>工号</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="teacherList"></tbody>
    </table>
</div>

<div id="teacherFormModal" class="layui-layer layui-layer-page" style="display:none;">
    <form class="layui-form" id="teacherForm">
        <input type="hidden" id="teacherId">
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-block">
                <input type="text" id="teacherName" name="name" class="layui-input" placeholder="请输入教师姓名">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                <select id="teacherSex" name="sex">
                    <option value="1">男</option>
                    <option value="2">女</option>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-block">
                <input type="number" id="teacherAge" name="age" class="layui-input" placeholder="请输入教师年龄">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">工号</label>
            <div class="layui-input-block">
                <input type="text" id="teachertno" name="tno" class="layui-input" placeholder="请输入教师工号">
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn layui-btn-normal" id="saveteacherBtn">保存</button>
                <button type="button" class="layui-btn layui-btn-primary" id="cancelBtn">取消</button>
            </div>
        </div>
    </form>
</div>

<script src="/pagejs/dp01.js"></script>
<script src="/js/layui.js"></script>
</body>
</html>
